package com.shy.controller;

import com.shy.config.model.R;
import com.shy.entity.Product;
import com.shy.service.ProductService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/product")
public class ProductController {
    @Resource
    private ProductService productService;
    @GetMapping("/list")
    public R<List<Product>> queryProductList() {
        List<Product> products = productService.queryProductList();
        return R.success(products);
    }
}
